package cn.edu.cug.cs.gtl.apis.render.paths;

import cn.edu.cug.cs.gtl.apis.render.NativeObjectWrapper;
import cn.edu.cug.cs.gtl.apis.render.nodes.Node;

public interface GeneralPath extends NativeObjectWrapper {

    /*
    Adds node to end of chain.
     */
    void	append(int childIndex);
    /*
    Adds node to end of chain.
     */
    void	append(Node childNode);
    /*
    Adds all nodes in fromPath's chain to end of chain.
     */
    void	append(Path fromPath);
    /*
    Returns true if the node type is found anywhere in the path chain.
     */
    boolean	containsNode(java.lang.Class type);

    /*
    Returns true if the node is found anywhere in the path chain.
     */
    boolean	containsNode(Node node);
    /*
    Returns true if the nodes in the given path argument are contained (in consecutive order) in this path.
     */
    boolean	containsPath(Path path);
    /*
    Creates and returns a new path that is a copy of some or all of this path.
     */
    Path	copy(int startFromNodeIndex);
    /*
    Creates and returns a new path that is a copy of some or all of this path.
     */
    Path	copy(int startFromNodeIndex, int numNodes);

    //If the two paths have different head nodes, this returns -1.
    int	findFork(Path path);

    //Return the first node in a path chain
    Node	getHead();

    //Return the index of the i'th node (within its parent) in the chain.
    int	getIndex(java.lang.Class type);
    int	getIndex(int i);

    //Return the index of the i'th node (within its parent) in the chain, counting backward from the tail node.
    int	getIndexFromTail(int i);

    //Returns the index of the instance inside the parent SoMultipleInstance, SoMultipleCopy or SoArray group.
    int	getInstanceIndex(int i);

    //Returns the index of the i'th node instance (within its parent, if it is a SoMultipleInstance, SoMultipleCopy or SoArray group in the chain, counting backward from the tail node.
    int	getInstanceIndexFromTail(int i);

    //Returns length of path chain (number of nodes).
    int	getLength();

    //Return the i'th node in the chain.
    Node	getNode(java.lang.Class type);
    Node	getNode(int i);

    //Return the i'th node in the chain, counting backward from the tail node.
    Node	getNodeFromTail(int i);

    //Return the last node in a path chain
    Node	getTail();

    void	pop();

    /*
    Push a node at the end of the chain.
     */
    void	push(int childIndex);
    /*
    Sets head node (first node in chain).
     */
    void	setHead(Node node);

    /*
    Truncates the path chain, removing all nodes from index start on.
     */
    void	truncate(int start);

}
